package com.yfqy.admin.domain.vo.common;

public final class ResultVOBuilder<T> {
    private Integer code;
    private String msg;
    private T data;

    public static <T> ResultVOBuilder<T> aResult() {
        return new ResultVOBuilder<>();
    }

    public ResultVOBuilder<T> code(Integer code) {
        this.code = code;
        return this;
    }

    public ResultVOBuilder<T> msg(String msg) {
        this.msg = msg;
        return this;
    }

    public ResultVOBuilder<T> data(T data) {
        this.data = data;
        return this;
    }

    public ResultVO<T> build() {
        ResultVO<T> result = new ResultVO<>();
        result.setCode(this.code);
        result.setMessage(this.msg);
        result.setData(this.data);
        return result;
    }
}
